<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <input type="button" value="载入新文档" onclick="newPage()">
    <input type="button" value="刷新页面"onclick="freshPage()">
    <p id="time"></p>
    <script>
    //或获取并显示当前页面载入的时间
    var ds=new Date(),d=ds.getDate();
    var t=ds.toLocaleTimeString();
    document.getElementById('tiime').innerHTML=t;
    //载入新文档
    function newPage(){
        window.location.assign('http://www.example.com')
    }//刷新文档
    function freshPage(){
        location.reload(true);
    }
    </script>
</body>
</html>